<?php
/**
 * 文章归档插件
 * @author MrHan<hcj112@163.com>
 */
class ArticleLog extends AddonsController
{
    public function right()
    {

        $data = D('Article')->field('create_time')->select();

        $date_array = array();
        foreach ($data as $value) {
            $date = date('Y-m', $value['create_time']);
            $date_array[$date]['num']++;
            $date_array[$date]['date'] = strtotime($date);
        }

        $this->assign('timelist', $date_array);
        $this->display('ArticleLog');

    }

}